<template>
  <div class="logoutbox">
    <img class="icon" :src="require('@/framework/assets/success.png')" alt="">
    <p class="tip">注销成功！</p>
    <p><el-button type="primary" @click="tologin">去登录</el-button> </p>
  </div>
</template>
<script>
import { getToken } from '@/framework/utils/auth'

export default {
  name: 'Logout',
  data() {
    return {

    }
  },
  mounted() {
    if (getToken()) {
      this.logout()
    }
  },
  methods: {
    async logout() {
      await this.$store.dispatch('user/logout')
      this.$router.push('/login')
    },
    tologin() {
      // this.$router.push('/login')
    }
  }
}
</script>

<style scoped>
.logoutbox{
    width: 300px;
    margin: 200px auto;
    text-align: center;
}
.tip{
    font-size: 40px;
    font-weight: bold;
    margin: 30px 0 200px;
}
.el-button{
    font-size: 16px;
    width: 100px;
}
</style>
